<?php
/**
 * @link https://ym2.cleverstone.top
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */



/* ====== 选项卡构建器 ====== */
/** @var \yii\web\View $this */
/** @var \builder\tab\TabBuilder $context */
/** @var string $theme 主题风格 */
/** @var array $tabItem 项配置 */
/** @var array $rootLayout 根布局 */

$context = $this->context;
?>
<?php if (!empty($tabItem)): ?>

<div class="pl-3 pr-4 <?= $rootLayout['class'] ?>"
     ng-controller="ym2.ctrl.<?= $context->id ?>"
     style="<?= $rootLayout['style'] ?>"
     <?= $rootLayout['attribute'] ?>>

    <div class="layui-tab <?= $theme ?>" lay-filter="ym2_builder_<?= $context->id ?>">
        <ul class="layui-tab-title">
            <?php foreach ($tabItem['tabLabel'] as $item): ?>

            <li class="<?= $item['selected'] ?>" lay-id="<?= $item['id'] ?>">
                <?= $item['label'] ?>
            </li>
            <?php endforeach; ?>

        </ul>
        <div class="layui-tab-content">
            <?php foreach ($tabItem['tabContent'] as $item): ?>

            <div class="layui-tab-item <?= $item['selected'] ?>">
                <?= $item['content'] ?>
            </div>
            <?php endforeach; ?>

        </div>
    </div>
</div>
<?php endif; ?>
